GNUPro Toolkit Documentation|Index|Next
Using `make`

A program for directing recompilation

    Copyright © 1988- 1997  Free Software Foundation, Inc.

    Published by the Free Software Foundation.

    Printed copies are available for $20 each.

    ISBN: 1-882114-50-7

    Free Software Foundation

    59 Temple Place / Suite 330

    Boston, MA   02111-1307    USA

    Permission is granted to make and distribute verbatim copies of this documentation
    provided the copyright notice and this permission notice are preserved on all copies.

    Permission is granted to copy and distribute modified versions of this documentation
    under the conditions for verbatim copying, provided that the entire resulting derived
    work is distributed under the terms of a permission notice identical to this one.

    Permission is granted to copy and distribute translations of this documentation into
    another language, under the above conditions for modified versions, except that
    this permission notice may be stated in a translation approved by the Free Software Foundation.

    This documentation has been prepared by Cygnus Technical Publications;
    to contact the Cygnus Solutions Technical Publications staff, e-mail: doc@cygnus.com.

    Copyright © 1992-1997   Cygnus Solutions. All rights reserved.

    GNUPro™, the GNUPro™ logo, and the Cygnus Solutions logo are trademarks of Cygnus Solutions.
    All other brand and product names are trademarks of their respective owners.

    The following documentation discusses GNU make, the utility for directing recompilation.

- Overview of make

- How to read this documentation
- Problems and bugs

- An introduction to makefiles

- What a rule looks like
- A simple makefile
- How make processes a makefile
- Variables make makefiles simpler
- Letting make deduce the commands
- Another style of makefile
- Rules for cleaning the directory

- Writing makefiles

- What makefiles contain
- What name to give your makefile
- Including other makefiles
- The variable, MAKEFILES
- How makefiles are remade
- Overriding part of another makefile

- Writing rules

- Rule syntax
- Using wildcard characters in file names

- Wildcard examples
- Pitfalls of using wildcards
- The function, wildcard

- Searching directories for dependencies

- VPATH: search path for all dependencies
- The vpath directive
- Writing shell Commands with directory search
- Directory search and implicit rules
- Directory search for link libraries

- Phony targets
- Rules without commands or dependencies
- Empty target files to record events
- Special built-in target names
- Multiple targets in a rule
- Multiple rules for one target
- Static pattern rules

- Syntax of static pattern rules
- Static pattern rules versus Implicit rules

- Double-colon rules
- Generating dependencies automatically

- Writing the commands in rules

- Command echoing
- Command execution
- Parallel execution
- Errors in commands
- Interrupting or killing make
- Recursive use of make

- How the MAKE variable works
- Communicating variables to a sub-make
- Communicating options to a sub-make
- The ‘--print-directory’ option

- Defining canned command sequences
- Using empty commands

- How to use variables

- Basics of variable references
- The two flavors of variables
- Advanced features for reference to variables

- Substitution references
- Computed variable names

- How variables get their values
- Setting variables
- Appending more text to variables
- The override directive
- Defining variables verbatim
- Variables from the environment

- Conditional parts of makefiles

- Example of a conditional
- Syntax of conditionals
- Conditionals that test flags

- Functions for transforming text

- Function call syntax
- Functions for string substitution and analysis
- Functions for file names
- The foreach function
- The origin function
- The shell function

- How to run make

- Arguments to specify the makefile
- Arguments to specify the goals
- Instead of executing the commands
- Avoiding recompilation of some files
- Overriding variables
- Testing the compilation of a program
- Summary of options

- Implicit rules

- Using implicit rules
- Catalogue of implicit rules
- Variables used by implicit rules
- Chains of implicit rules
- Defining and redefining Pattern rules

- Introduction to pattern rules
- Pattern rule examples
- Automatic variables
- How patterns match
- Match-anything pattern rules
- Canceling implicit rules

- Defining last-resort default rules
- Old-fashioned suffix rules
- Implicit rule search algorithm

- Using make to update archive files

- Archive members as targets
- Implicit rule for archive member targets

- Updating archive symbol directories

- Dangers when using archives
- Suffix rules for archive files

- Features of GNU make
- Incompatibilities and missing meatures
- Makefile conventions

- General conventions for makefiles
- Utilities in makefiles
- Standard targets for users
- Variables for specifying commands
- Variables for Installation Directories

- Quick reference
- Complex makefile example
- Index

Top|GNUPro Toolkit Documentation|Index|Next